package com.imufe.chemicalenterprisedangerwarning.service.impl;

import com.imufe.chemicalenterprisedangerwarning.entity.po.EnterpriseTypePO;
import com.imufe.chemicalenterprisedangerwarning.entity.vo.EnterpriseTypeVO;
import com.imufe.chemicalenterprisedangerwarning.mapper.EnterpriseTypeMapper;
import com.imufe.chemicalenterprisedangerwarning.service.EnterpriseTypeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.imufe.chemicalenterprisedangerwarning.util.ListUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 企业类型表 服务实现类
 * </p>
 *
 * @author BaiBan
 * @since 2022-09-22
 */
@Service
public class EnterpriseTypeServiceImpl extends ServiceImpl<EnterpriseTypeMapper, EnterpriseTypePO> implements EnterpriseTypeService {

    @Autowired
    EnterpriseTypeMapper mapper;

    @Override
    public List<EnterpriseTypeVO> optionList() {
        List<EnterpriseTypePO> poList = mapper.selectList(null);
        // po 转 vo
        return ListUtils.copyList(poList, EnterpriseTypeVO.class);
    }
}
